<template>
	<view class="x-wrapper">
		<view class="x-main-content">
			<view class="account-box">
				<image src="http://www.peiyiyiliao.com/QRCodeShare/imgs/bg.png" mode="" class="bg"></image>
				<view class="content-box">
					<u-navbar title="我的账户" :bgColor="bgColor" :fixed="true" leftIcon="arrow-left" leftIconColor="#000"
						leftIconSize="42rpx" autoBack placeholder>
					</u-navbar>
					<view class="inner">
						<view class="inner_nr">
							<view class="inner_nr_top">
								<text class="inner_bt">当前账户余额</text>
								<view style="display: flex;justify-content: space-between;align-items: center;">
									<text class="inner_account">¥{{cash}}</text>
									<view
										style="border: 1px solid #386fff;color: #386fff;font-size: 30rpx;padding: 8rpx 40rpx;border-radius: 30rpx;"
										@click="goWithdrawal">
										提现
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="detail_box">
						<span
							style="display: inline-block;height: 20rpx;border-bottom: 20rpx solid  #9bb7ff ;color: #333; font-weight: 600;">余额记录</span>
						<view class="detail_nr" v-for="item in accountInfor" :key="item.time">
							<text class="detail_nr_time">{{item.time}}</text>
							<text :class="item.type">{{item.money}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgColor: 'transparent',
				commonBtnStyle: {
					width: '300rpx',
					height: '66rpx',
					borderRadius: '19rpx',
				},
				money: 0,
				accountInfor: []
			}
		},
		computed: {
			cash() {
				return this.money.toFixed(2)
			}
		},
		methods: {
			moneyStyle(ctx) {
				if (ctx.type == 'income') {
					return 'income-M'
				} else if (ctx.type == 'expenditure') {
					return 'expenditure-M'
				}
			},
			goWithdrawal() {
				console.log('提现')
			}
		},
	}
</script>

<style lang="scss" scoped>
	.account-box {
		position: relative;

		.bg {
			position: absolute;
			height: 100vh;
			width: 100%;
			top: 0;
			left: 0;
			z-index: 1;
		}

		.content-box {
			position: relative;
			z-index: 2;
		}
	}

	.inner {
		padding: 0 40rpx;

		.inner_nr {
			position: relative;
			top: 60rpx;
			background: #fff;
			border-radius: 20rpx;
			padding: 20rpx 20rpx;

			.inner_nr_top {
				display: flex;
				flex-direction: column;

				.inner_account {
					font-size: 60rpx;
					font-family: HelveticaNeue-Medium, HelveticaNeue;
					font-weight: 500;
					color: #386FFF;
					letter-spacing: 2px;
				}

			}

			.inner_bt {
				font-size: 22rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #b7b7b7;
				letter-spacing: 1px;
			}

			.inner_nr_center {
				margin-top: 40rpx;
				display: flex;
				justify-content: space-around;

				.inner_nr_center_box {
					display: flex;
					align-items: center;
					flex-direction: column;

					.number {
						font-size: 37rpx;
						font-family: HelveticaNeue-Medium, HelveticaNeue;
						font-weight: 500;
						color: #20202A;
						letter-spacing: 1px;
					}
				}
			}
		}
	}

	.detail_box {
		margin: 20rpx;
		padding: 30rpx;
		top: 120rpx;
		position: relative;
		background-color: #FFF;
		border-radius: 30rpx;

		.detail_nr {
			display: flex;
			padding: 30rpx 20rpx;
			justify-content: space-between;
			border-bottom: 1px solid #E1E6EE;

			.income {
				color: #ff9142
			}

			.expenditure {
				color: #3a3a3a
			}
		}

		image {
			width: 152rpx;
			height: 50rpx;
		}
	}
</style>